using B.S.BasicData.Domain;
using B.S.BasicData.EroorCode;
using B.S.BasicData.Infrature;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using MediatR;

namespace B.S.BasicData.Api.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class ProductNameController : ControllerBase
    {
        private readonly IMediator _mediator;
        public ProductNameController(IMediator mediator)
        {
            _mediator = mediator;
        }

        [HttpGet("all")]
        public async Task<ActionResult<ApiResult<List<ProductName>>>> GetAll()
        {
            var result = await _mediator.Send(new ProductNameListRequest());
            return Ok(result);
        }
    }
} 